import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:umeng_push_demo/model/push_message_model.dart';

/// FileName home_list_cell
///
/// @Author 陈晓星
/// @Date 2024/10/28 11:12
///
/// @Description TODO

class HomeListCell extends StatelessWidget {
  const HomeListCell({
    super.key,
    required this.messageModel
  });

  final PushMessageModel messageModel;

  @override
  Widget build(BuildContext context) {
    final textStyle = TextStyle(
      color: Colors.black87,
      fontSize: 13.w,
    );
    final themeColor = Theme.of(context).primaryColor;
    return DecoratedBox(
      decoration: BoxDecoration(
        color: messageModel.type == PushMessageType.custom ? themeColor.withOpacity(0.05) : Colors.white
      ),
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 10.w),
        child: DecoratedBox(
          decoration: BoxDecoration(
              border: Border(
                  bottom: BorderSide(
                    width: 1.0, // 边框宽度
                    color: themeColor.withOpacity(0.3), // 边框颜色
                  )
              )
          ),
          child: Padding(
            padding: EdgeInsets.symmetric(vertical: 10.w),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  '时间: ${messageModel.dateTime}',
                  style: textStyle,
                ),
                SizedBox(height: 3.w,),
                // Text(
                //   'DeviceToken: ${messageModel.deviceToken}',
                //   style: textStyle,
                // ),
                // SizedBox(height: 3.w,),
                // Text(
                //   '标签: ${messageModel.tag}, 别名: ${messageModel.alias}',
                //   style: textStyle,
                // ),
                // SizedBox(height: 3.w,),
                Text(
                  '内容: ${messageModel.content}',
                  style: textStyle,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
